/**
 *
 */
export default {
  formatNumber: num => {
    num = parseFloat(num)
    if (isNaN(num)) {
      return 0
    }
    if (num < 1000) {
      return num
    }

    num /= 1000

    if (num < 1000) {
      return `${num.toFixed(1)}K`
    }
    num /= 1000

    return `${num.toFixed(1)}M`
  }
}
